/* user-passport/1.0.0 login.submit.js md5:a09a8f2f77b5b883121d5aeb1cdcdfb5 */
define("/includes/libraries/javascript/login/login.submit.js", ["/includes/libraries/javascript/login/login.status.js", "/includes/libraries/javascript/login/login.message.js", "/includes/libraries/javascript/login/login.pubSub.js"],
		function(require) {
	var c = require("/includes/libraries/javascript/login/login.status.js");
	var d = require("/includes/libraries/javascript/login/login.message.js");
	require("/includes/libraries/javascript/login/login.pubSub.js");
	var f = {
			elelist: {
				nameEle: $("#loginname"),
				pwdEle: $("#nloginpwd"),
				authEle: $("#authcode")
			},
			clear: function() {
				$("#o-authcode, #entry, .item-fore1").removeClass("item-error item-focus")
			},
			showError: function(a, b, c) {
				var d = '<div class="msg-warn"><b></b>' + a + "</div>";
				var e = '<div class="msg-error"><b></b>' + a + "</div>";
				$("#chkOpenCtrl").prop("checked");
				"warn" == b && ($(".msg-wrap .msg-error").hide(), $(".msg-wrap .msg-warn").replaceWith(d)),
				"error" == b && ($(".msg-wrap .msg-warn").hide(), $(".msg-wrap .msg-error").replaceWith(e)),
				f.clear();
				for (var h = 0; h < c.length; h++) $(c[h]).parent().addClass("item-error")
			},
			validateAll: function() {
				var b = $.trim(this.elelist.nameEle.val());
				var e = $.trim(this.elelist.pwdEle.val());
				var f = "undefined" != typeof pgeditor && pgeditor.pwdResult();
				var g = "undefined" != typeof pgeditor && pgeditor.checkInstall();
				var h = $(".safe-chk").prop("checked");
				var i = $("#o-authcode").is(":visible");
				var j = $.trim($("#authcode").val());
				return this.clear(),
				b.length || e.length || h ? !b.length && g && !f.length && h ? c.onError(d.NAME_PASSWORD_EMPTY, [this.elelist.nameEle, this.elelist.pwdEle]) : b.length ? e.length || h ? g && !f.length && h ? c.onError(d.PASSWORD_EMPTY, this.elelist.pwdEle) : i && !j.length ? c.onError(d.AUTHCODE_EMPTY, this.elelist.authEle) : (assemblyForm(), void loginSubmit(this.showError)) : c.onError(d.PASSWORD_EMPTY, this.elelist.pwdEle) : c.onError(d.NAME_EMPTY, this.elelist.nameEle) : c.onError(d.NAME_PASSWORD_EMPTY, [this.elelist.nameEle, this.elelist.pwdEle])
			},
			init: function() {
				var a = this;
				$("#loginsubmit").bind("click",
						function() {
					a.validateAll.call(a)
				}),
				$("#loginname").bind("keyup",
						function(a) {
					13 != a.keyCode || $(".sugcontent li").length || $("#nloginpwd").focus()
				})
				$("#nloginpwd").bind("keyup",
						function(a) {
					13 != a.keyCode || $(".sugcontent li").length || $("#authcode").focus()
				})
				$("#authcode").bind("keyup",
						function(a) {
					13 != a.keyCode || $(".sugcontent li").length || $("#loginsubmit").click()
				})
			}
	};
	return f.init()
});